package com.ponhu.ea2.goodsCenter.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ponhu.ea2.entity.PhWarehousingMethodCode;
import com.ponhu.ea2.goodsCenter.provider.mapper.PhWarehousingMethodCodeMapper;
import com.ponhu.ea2.goodsCenter.provider.service.PhWarehousingMethodCodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 入库方式对应的货品编码表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-11-18
 */
@Service
public class PhWarehousingMethodCodeServiceImpl
        extends ServiceImpl<PhWarehousingMethodCodeMapper, PhWarehousingMethodCode>
        implements PhWarehousingMethodCodeService {

    @Override
    public PhWarehousingMethodCode getMethodCodeByType(String type) {
        LambdaQueryWrapper<PhWarehousingMethodCode> queryWrapper = Wrappers
                .lambdaQuery(PhWarehousingMethodCode.class)
                .eq(PhWarehousingMethodCode::getType, type);

        return getOne(queryWrapper);
    }

}
